/*
 * PyramideIntervalle.java Created on 24 avril 2007, 14:40 To change this template, choose Tools | Template Manager and open the template in the editor.
 */

package fr.limsi.seven;

import java.util.LinkedList;

/**
 * @author amazaud
 */
public class PyramideIntervalle extends PyramideAbstractVariableNode {
	public static int PYRAMIDE_VARIABLE_TYPE_INTERVALLE = 2;

	@Override
	public int getVarType() {
		return PYRAMIDE_VARIABLE_TYPE_INTERVALLE;
	}

	/** Creates a new instance of PyramideIntervalle */

	public PyramideIntervalle(int varID, int nodeID, String varName, double min, double max) throws PyramideVariableException {
		super(varID, nodeID, varName);

		min_value = min;
		max_value = max;

		modalites = new LinkedList<PyramideVariableNodeModalite>();

		PyramideVariableNodeModalite mod = new PyramideVariableNodeModalite(min);
		modalites.add(mod);
		updateGlobalVarModalite("min", mod);
		mod = new PyramideVariableNodeModalite(max);
		modalites.add(mod);
		updateGlobalVarModalite("max", mod);
	}

	@Override
	public String toString() {
		return "(var " + getVarID() + " node " + getVarNodeID() + ") Intervalle \"" + getVarName() + "\"\n\tx � {" + min_value + ", " + max_value + "}";
	}
}
